import request from '@/config/axios'

// 意见反馈 VO
export interface FeedbackVO {
  id: number // 主键
  userId: number // 用户编号
  content: string // 反馈内容
  attch: string // 附件（多个）
}

// 意见反馈 API
export const FeedbackApi = {
  // 查询意见反馈分页
  getFeedbackPage: async (params: any) => {
    return await request.get({ url: `/business/feedback/page`, params })
  },

  // 查询意见反馈详情
  getFeedback: async (id: number) => {
    return await request.get({ url: `/business/feedback/get?id=` + id })
  },

  // 新增意见反馈
  createFeedback: async (data: FeedbackVO) => {
    return await request.post({ url: `/business/feedback/create`, data })
  },

  // 修改意见反馈
  updateFeedback: async (data: FeedbackVO) => {
    return await request.put({ url: `/business/feedback/update`, data })
  },

  // 删除意见反馈
  deleteFeedback: async (id: number) => {
    return await request.delete({ url: `/business/feedback/delete?id=` + id })
  },

  // 导出意见反馈 Excel
  exportFeedback: async (params) => {
    return await request.download({ url: `/business/feedback/export-excel`, params })
  },
}